package com.mall.server.controller.sms;

import com.mall.model.domain.SmsCouponHistory;
import com.mall.model.vo.CommonPage;
import com.mall.model.vo.CommonResult;
import com.mall.server.service.sms.SmsCouponHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/couponHistory")
public class SmsCouponHistoryController {

    @Autowired
    private SmsCouponHistoryService smsCouponHistoryService;

    /**
     * 根据优惠券id，使用状态，订单编号分页获取领取记录
     */
    @GetMapping("/list")
    public CommonResult list(@RequestParam(defaultValue = "1") Integer pageNum
            , @RequestParam(defaultValue = "10") Integer pageSize,
                             SmsCouponHistory history) {

        CommonPage list = smsCouponHistoryService.list(pageNum, pageSize, history);

        return CommonResult.success(list);
    }

}
